/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.global.modelo;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "USR_TVDESC",schema = "dbo")
@IdClass(ItemDescargaPK.class)
public class ItemDescarga implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id    
    @Column(name = "USR_TVDESC_TVCONF_ID", nullable = false, length = 2)
    private Integer id;

    @Id    
    @Column(name = "USR_TVDESC_CODIGO", nullable = false, length = 2)
    private Integer nroitm;

    @ManyToOne
    @JoinColumn(name = "USR_TVDESC_TVCONF_ID", referencedColumnName = "USR_TVCONF_ID", nullable = false, insertable=false, updatable=false)
    private Parametro parametro;



    @Column(name = "USR_TVDESC_DESCRP", length = 60)
    private String descripcion;

    @Column(name = "USR_TVDESC_LINK", length = 80)
    private String link;
    
    @Column(name = "USR_TVDESC_PATHIM", length = 200)
    private String  pathImagenes;

    

    public ItemDescarga() {
    }

    public ItemDescarga(String descripcion, String link) {
        this.descripcion = descripcion;
        this.link = link;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public Integer getId() {
        return id;
    }

    public Parametro getParametro() {
        return parametro;
    }

    public void setParametro(Parametro parametro) {
        this.parametro = parametro;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getNroitm() {
        return nroitm;
    }

    public void setNroitm(Integer nroitm) {
        this.nroitm = nroitm;
    }

    public String getPathImagenes() {
        return pathImagenes;
    }

    public void setPathImagenes(String pathImagenes) {
        this.pathImagenes = pathImagenes;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ItemDescarga other = (ItemDescarga) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if (this.nroitm != other.nroitm && (this.nroitm == null || !this.nroitm.equals(other.nroitm))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 41 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 41 * hash + (this.nroitm != null ? this.nroitm.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "ItemDescarga{" + "id=" + id + "nroitm=" + nroitm + '}';
    }
}
